package com.isunland.managesystem.ui;

import android.support.v4.app.Fragment;
import com.isunland.managesystem.R;
import com.isunland.managesystem.base.BasePagerActivity;
import com.isunland.managesystem.entity.ProcessContent;

public class WorkProcessEditActivity extends BasePagerActivity
    implements WorkProcessEditFragment.Callbacks {

  private int[] title = { R.string.planDetailList, R.string.workRecord };
  private WorkProcessDetailListFragment detailFragment = new WorkProcessDetailListFragment();

  @Override protected Fragment createFragmentOne() {
    ProcessContent item = (ProcessContent) getIntent().getSerializableExtra(
        WorkProcessEditFragment.EXTRA_PROCESS_CONTENT);
    return WorkProcessEditFragment.newInstance(item);
  }

  @Override protected Fragment createFragmentTwo() {
    //		detailFragment=new WorkProcessDetailListFragment();
    //		String id=getIntent().getStringExtra(WorkProcessDetailListFragment.EXTRA_ITEM);
    ProcessContent item = (ProcessContent) getIntent().getSerializableExtra(
        WorkProcessEditFragment.EXTRA_PROCESS_CONTENT);
    return detailFragment = WorkProcessDetailListFragment.newInstance(item);
  }

  @Override protected int[] createTitle() {
    return title;
  }

  @Override public void onRefresh() {
    setNavigateTo(1);
    detailFragment.refresh();
  }

  //    @Override
  //    protected boolean isOverLay() {
  //        return false;
  //    }
}
